//------------------------------------------------------------------------------
//  <copyright file="FRIServerTest.h" company="Microsoft Corporation">
// The MIT License (MIT)
// 
// Copyright (c) 2014, Microsoft Corporation
// 
// Permission is hereby granted, free of charge, to any person obtaining a copy
//  of this software and associated documentation files (the "Software"), to deal
//  in the Software without restriction, including without limitation the rights
//  to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
//  copies of the Software, and to permit persons to whom the Software is
//  furnished to do so, subject to the following conditions:
// 
// The above copyright notice and this permission notice shall be included in
//  all copies or substantial portions of the Software.
// 
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
//  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
//  THE SOFTWARE.
//  </copyright>
//------------------------------------------------------------------------------

#pragma once

#include "stdafx.h"
#include "KukaLBR4HardwareTests.h"
#include "KukaLBR4NativeTestLibImportExport.h"
#include "SimpleMockFRIRemote.h"
#include "TestResultStringCommon.h"

#include <FriServer.h>

/// <summary> Unit tests for the <c>FRIServer</c> class. </summary>
class FRIServerTest : public TestResultStringCommon
{
public:
	/// <summary> Test basic functionality of <c>DoNothing</c> method. </summary>
	static void FRIServerDoNothingTest();

	/// <summary> Test basic functionality of <c>DoPositionControl</c> method. </summary>
	static void FRIServerDoPositionControlTest();

	/// <summary> Test basic functionality of <c>WaitOnFRIConnection</c> method. </summary>
	static void FRIServerWaitOnFRIConnectTest();

	/// <summary> Test basic functionality of <c>GetFRIRequest</c> method. </summary>
	static void FRIServerGetFRIRequestTest();

	/// <summary> Test basic functionality of <c>GetFRIQuality</c> method. </summary>
	static void FRIServerGetFRIQualityTest();

	/// <summary> Test basic functionality of <c>DoCartesianImpedanceControl</c> method. </summary>
	static void FRIServerDoCartesianImpedanceControlTest();

	/// <summary> Test basic functionality of <c>DoKrlCartesianImpedanceControl</c> method. </summary>
	static void FRIServerDoKrlCartesianImpedanceControlTest();

	/// <summary> Test that methods behave properly when pFRIRemote is null </summary>
	static void FRIServerInvalidFRIRemoteTest();
};

/// <summary> Test basic functionality of <c>DoNothing</c> method. </summary>
/// <param name="resultString"> buffer for a failure message or indication that test passed. </param>
/// <param name="buffersize"> length of <c>resultString</c> buffer. </param>
extern "C" KUKALBR4NATIVETESTS_API void FRIServerDoNothingTest(char* resultString, int bufferSize);

/// <summary> Test basic functionality of <c>DoPositionControl</c> method. </summary>
/// <param name="resultString"> buffer for a failure message or indication that test passed. </param>
/// <param name="buffersize"> length of <c>resultString</c> buffer. </param>
extern "C" KUKALBR4NATIVETESTS_API void FRIServerDoPositionControlTest(char* resultString, int bufferSize);

/// <summary> Test basic functionality of <c>WaitOnFRIConnection</c> method. </summary>
/// <param name="resultString"> buffer for a failure message or indication that test passed. </param>
/// <param name="buffersize"> length of <c>resultString</c> buffer. </param>
extern "C" KUKALBR4NATIVETESTS_API void FRIServerWaitOnFRIConnectTest(char* resultString, int bufferSize);

/// <summary> Test basic functionality of <c>GetFRIRequest</c> method. </summary>
/// <param name="resultString"> buffer for a failure message or indication that test passed. </param>
/// <param name="buffersize"> length of <c>resultString</c> buffer. </param>
extern "C" KUKALBR4NATIVETESTS_API void FRIServerGetFRIRequestTest(char* resultString, int bufferSize);

/// <summary> Test basic functionality of <c>GetFRIQuality</c> method. </summary>
/// <param name="resultString"> buffer for a failure message or indication that test passed. </param>
/// <param name="buffersize"> length of <c>resultString</c> buffer. </param>
extern "C" KUKALBR4NATIVETESTS_API void FRIServerGetFRIQualityTest(char* resultString, int bufferSize);

/// <summary> Test basic functionality of <c>DoCartesianImpdedanceControl</c> method. </summary>
/// <param name="resultString"> buffer for a failure message or indication that test passed. </param>
/// <param name="buffersize"> length of <c>resultString</c> buffer. </param>
extern "C" KUKALBR4NATIVETESTS_API void FRIServerCartesianImpedanceControlTest(char* resultString, int bufferSize);

/// <summary> Test basic functionality of <c>DoKrlCartesianImpdedanceControl</c> method. </summary>
/// <param name="resultString"> buffer for a failure message or indication that test passed. </param>
/// <param name="buffersize"> length of <c>resultString</c> buffer. </param>
extern "C" KUKALBR4NATIVETESTS_API void FRIServerKrlCartesianImpedanceControlTest(char* resultString, int bufferSize);

/// <summary> Test basic functionality of <c>DoKrlCartesianImpdedanceControl</c> method. </summary>
/// <param name="resultString"> buffer for a failure message or indication that test passed. </param>
/// <param name="buffersize"> length of <c>resultString</c> buffer. </param>
extern "C" KUKALBR4NATIVETESTS_API void FRIServerKrlCartesianImpedanceControlTest(char* resultString, int bufferSize);

/// <summary> Test that methods behave properly when FRI server has been closed. </summary>
/// <param name="resultString"> buffer for a failure message or indication that test passed. </param>
/// <param name="buffersize"> length of <c>resultString</c> buffer. </param>
extern "C" KUKALBR4NATIVETESTS_API void FRIServerInvalidFRIRemoteTest(char* resultString, int bufferSize);
